package com.Maykk.Demo01;

/**
 * @ClassName: com.Maykk.Demo01.Demo02
 * @Description: TODO 设置与获取线程优先级
 * @Author: MaykkStar@163.com
 */
public class Demo02 {
    public static void main(String[] args) {
        MyThread mt01 = new MyThread("线程1");
        MyThread mt02 = new MyThread("线程2");
        MyThread mt03 = new MyThread("线程3");

        // 设置线程优先级 -- 作用很小，只需要了解即可
        mt01.setPriority(Thread.MIN_PRIORITY);
        mt02.setPriority(Thread.NORM_PRIORITY);
        mt03.setPriority(Thread.MAX_PRIORITY);

        // 获取线程优先级
        // System.out.println(mt01.getPriority());
        // System.out.println(mt02.getPriority());
        // System.out.println(mt03.getPriority());

        // 测试多线程
        mt01.start();
        mt02.start();
        mt03.start();
    }
}
